home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 5 / Amiga Tools 5.iso / tools / dfÜ / bbs / tronbbs / tron / docs / demodoor / adoor.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-07-16  |  8.5 KB  |  250 lines

  1.  
  2. /*  Tron BBS 'Additional Clidoor Support' system header file            */
  3. /*                                                                      */
  4. /*  V 1.00   25 - 11 - 1995                                             */
  5. /*                                                                      */
  6. /*  (c) Copyright 1995 by Paul Spijkerman                               */
  7.  
  8.  
  9.  
  10. #include <exec/types.h>
  11. #include <exec/ports.h>
  12. #include <exec/memory.h>
  13. #include <dos/dos.h>
  14. #include <clib/exec_protos.h>
  15. #include <clib/alib_protos.h>
  16. #include <clib/dos_protos.h>
  17. #include <stdio.h>
  18. #include <strings.h>
  19. #include <stdlib.h>
  20. #include <stdarg.h>
  21.  
  22.  
  23. #define CTRL(x)             (x - 'a' + 1)
  24.  
  25.  
  26.  
  27. struct ADoorMessage {
  28.    struct Message    ADS_Msg;
  29.    UBYTE             ADS_Command;
  30.    UBYTE             ADS_SubCommand;
  31.  
  32.    BYTE              ADS_Result;
  33.    UBYTE             ADS_Carrier;
  34.  
  35.    ULONG             ADS_Data_long;
  36.    UWORD             ADS_Data_word;   
  37.  
  38.    void             *ADS_P;
  39.    char              ADS_String[80];
  40. };
  41.  
  42.  
  43. /* In the new 'ADS' system there is a Result field for simplicity and  */
  44. /* to avoid the confusion when the Result was in the Command field     */
  45. /* If Result is smaller then zero the operation failed                 */
  46. /*    -2   ..  Can't find BBS node (not stored in the result field)    */
  47. /*    -1   ..  means the command doesn't exists                        */
  48. /*     0   ..  Command exited succesfully                              */
  49.  
  50.  
  51.  
  52.  
  53. struct ADS_Data  {                      /* ADS_DATA */
  54.    struct ADoorMessage    *BBSMsg;
  55.    struct MsgPort         *BBSreplyport;
  56.    int                    node;
  57.    int                    quiet;
  58.    int                    IDMode;
  59. };
  60.  
  61.  
  62.  
  63. struct DoorIO {             /*   'Pure' Door :))   */
  64.    BPTR              ConInput;
  65.    BPTR              ConOutput;
  66.    int               carrier;
  67.  
  68.    /* extra voor kleur, position */
  69.  
  70.    int   mfc  , mbc;        /* Foreground, Background colour memory  */
  71.    int   mx   , my;         /* Cursor pos. memory                    */
  72.    int   xmax , ymax;       /* Scherm grootte                        */
  73.    int   mhigh;             /* Bold attribute, high intensity colors */
  74. };
  75.  
  76.  
  77.  
  78.  
  79.  
  80. #define     ADSC_DROP_CARRIER                   16
  81. #define     ADSC_STRING_TO_LOG                  17
  82. #define     ADSC_TYPE_FILE                      18
  83. #define     ADSC_GET_TIME_ONLINE                19
  84. #define     ADSC_CHANGE_TIME_ONLINE             20
  85.  
  86. #define     ADSC_MARK_DOS_FILE                  32
  87. #define     ADSC_UNMARK_ALL_DOSFILES            33
  88. #define     ADSC_DOWNLOAD_DOS_FILES             34
  89.  
  90. #define     ADSC_PAGE_SYSOP                     48
  91. #define     ADSC_PLAY_SAMPLE                    49
  92. #define     ADSC_CHECK_SYSOP_AVAILABLE          50
  93. #define     ADSC_SPLIT_CHAT_MODE                51
  94.  
  95. #define     ADSC_GET_USER_DATA                  64
  96. #define     ADSC_CHANGE_USER_DATA               65
  97. #define     ADSC_GET_SYSTEM_DATA                66
  98.  
  99.  
  100.  
  101. #define     ADSC_FLUSH_BUFFER                  126
  102. #define     ADSC_PUSHINTOBUFFER                127
  103.  
  104. /* debug functions .. do not use !! */
  105.  
  106. #define     ADSC_PRINT                         128
  107. #define     ADSC_GETCHAR                       129
  108. #define     ADSC_MAYGETCHAR                    130
  109. #define     ADSC_NO_OPERATION                  131    /* check carrier */
  110.  
  111.  
  112.  
  113.  
  114. int   SetopPort      (struct ADS_Data *p, int node, int quiet);
  115. int   RemovePort     (struct ADS_Data *p);
  116.  
  117.  
  118. int   DropCarrier    (struct ADS_Data *p);
  119. int   PrintToLog     (struct ADS_Data *p, char *string);
  120. int   TypeFile       (struct ADS_Data *p, char *string);
  121. int   GetTimeOnline  (struct ADS_Data *p);
  122. int   IncreaseTimeOnline(struct ADS_Data *p, int time);
  123. int   DecreaseTimeOnline(struct ADS_Data *p, int time);
  124.  
  125. int   Download       (struct ADS_Data *p);
  126. int   MarkFile       (struct ADS_Data *p, char *str);
  127. int   UnmarkAllFiles (struct ADS_Data *p);
  128.  
  129. int   PageSysop      (struct ADS_Data *p);
  130. int   PlaySample     (struct ADS_Data *p, char *sample);
  131. int   PlaySampleNum  (struct ADS_Data *p, char *sample, int num);
  132. int   CheckSysopAvailable(struct ADS_Data *p);
  133. int   SplitChatMode  (struct ADS_Data *p, int mode);
  134.  
  135. int   GetUserStringField(struct ADS_Data *p, int field, char *string);
  136. int   GetUserNumericalField(struct ADS_Data *p, int field, ULONG *var);
  137. int   ChangeUserStringField(struct ADS_Data *p, int field, char *string);
  138. int   ChangeUserNumericalField(struct ADS_Data *p, int field, ULONG var);
  139.  
  140. int   GetBaudRate(struct ADS_Data *p, UWORD *local, ULONG *baudrate);
  141.  
  142.  
  143. int   FlushBuffer    (struct ADS_Data *p);
  144. int   PushIntoBuffer (struct ADS_Data *p, char *str);
  145.  
  146.  
  147.  
  148. void  SetOpIO        (struct DoorIO *p);
  149. void  RemoveIO       (struct DoorIO *p);
  150. UBYTE GetCharacter   (struct DoorIO *p);
  151. UBYTE MayGetCharacter(struct DoorIO *p);
  152. int   GetString      (struct DoorIO *p, char *str, int strsize);
  153. int   Carrier        (struct DoorIO *p);
  154. int   nprintf        (struct DoorIO *p, char *fmt, ...);
  155. int   brk            (void);
  156.  
  157.  
  158.  
  159.  
  160. /* voor en achtergrond kleuren  */
  161. /* voor voorgrond kleuren wordt het BOLD atribute uitgezet ( esc[0m code ) */
  162.  
  163. #define BLACK     0x00     /* blue    in cli tot V1.3  */
  164. #define RED       0x01     /* white   */
  165. #define GREEN     0x02     /* black   */
  166. #define YELLOW    0x03     /* orange  */
  167. #define BLUE      0x04     /* blue    */
  168. #define MAGENTA   0x05     /* white   */
  169. #define CYAN      0x06     /* black   */
  170. #define WHITE     0x07     /* orange  */
  171.  
  172. /* high intensity voorgrond kleuren                         */
  173. /* hierbij wordt het BOLD atribute aangezet ( esc[1m code ) */
  174.  
  175. #define HBLACK    0x08     /* blue    in cli tot V1.3  */
  176. #define HRED      0x09     /* white   */
  177. #define HGREEN    0x0a     /* black   */
  178. #define HYELLOW   0x0b     /* orange  */
  179. #define HBLUE     0x0c     /* blue    */
  180. #define HMAGENTA  0x0d     /* white   */
  181. #define HCYAN     0x0e     /* black   */
  182. #define HWHITE    0x0f     /* orange  */
  183.  
  184. #define NONE        0x00    /* geen atrribute aan  */
  185. #define BOLD        0x01
  186. #define FAINT       0x02
  187. #define ITALIC      0x03
  188. #define UNDERSCORE  0x04
  189. #define BLINK       0x05
  190. #define INVERS      0x07
  191. #define SUBSCRIPT   0x30    /* decimaal 48 */
  192. #define SUPERSCRIPT 0x31    /* decimaal 49 */
  193. #define INVISIBLE   0x08
  194.  
  195.  
  196. void cursxy  (struct DoorIO *p, int x,int y);
  197. void col     (struct DoorIO *p, int fc,int bc);
  198. void fcol    (struct DoorIO *p, int fc);
  199. void bcol    (struct DoorIO *p, int bc);
  200. void atr     (struct DoorIO *p, int atr);
  201. void norm    (struct DoorIO *p);
  202. void cls     (struct DoorIO *p);
  203.  
  204.  
  205.  
  206. /* User Data String Fields  */
  207. /* size includes terminating '\0' character */
  208.  
  209. #define  UDSF_NAME             (64+ 0)      /* size=37  check for succes !! */
  210. #define  UDSF_ALIAS            (64+ 1)      /* size=37  check for succes !! */
  211. #define  UDSF_PASSWORD         (64+ 2)      /* size=17  */
  212. #define  UDSF_PLAATS           (64+ 3)      /* size=40  */
  213. #define  UDSF_VOICEPHONE       (64+ 4)      /* size=40  */
  214. #define  UDSF_DATAPHONE        (64+ 5)      /* size=40  */
  215.  
  216. /* User Data Numerical Fields  */
  217.  
  218. #define  UDNF_NUMMER           (128+ 0)      /* LONG   Do not change field !! */
  219. #define  UDNF_CALLS            (128+ 1)      /* ULONG  */
  220. #define  UDNF_LEVEL            (128+ 2)      /* UBYTE  */
  221. #define  UDNF_SCREENLENGTH     (128+ 3)      /* UBYTE  */
  222. #define  UDNF_CALLSTODAY       (128+ 4)      /* UBYTE  */
  223. #define  UDNF_CALLLIMITPERDAY  (128+ 5)      /* UBYTE  */
  224. #define  UDNF_TIMELIMIT        (128+ 6)      /* UWORD  */
  225. #define  UDNF_TIMEREMAINING    (128+ 7)      /* UWORD  Do not use !! */
  226. #define  UDNF_EDITOR           (128+ 8)      /* UBYTE  */
  227. #define  UDNF_PROTOCOL         (128+ 9)      /* UBYTE  */
  228. #define  UDNF_FILERATIO        (128+10)      /* UBYTE  */
  229. #define  UDNF_BYTERATIO        (128+11)      /* UBYTE  */
  230. #define  UDNF_FILESDOWNLOADEDTODAY  (128+12) /* UBYTE  */
  231. #define  UDNF_DOWNLOADS        (128+13)      /* UWORD  */
  232. #define  UDNF_UPLOADS          (128+14)      /* UWORD  */
  233. #define  UDNF_DOWNLOADBYTES    (128+15)      /* ULONG  */
  234. #define  UDNF_UPLOADBYTES      (128+16)      /* ULONG  */
  235. #define  UDNF_MAXBYTESPERDAY   (128+17)      /* ULONG  */
  236. #define  UDNF_BYTESDOWNLOADEDTODAY  (128+18) /* ULONG  */
  237. #define  UDNF_MAXMSGSPERDAY    (128+19)      /* UBYTE  */
  238. #define  UDNF_MSGSWRITTENTODAY (128+20)      /* UBYTE  */
  239. #define  UDNF_MESSAGES         (128+21)      /* ULONG  */
  240. #define  UDNF_MENUSET          (128+22)      /* UBYTE  */
  241.  
  242. #define  UDNF_TOTDOWNLOADS     (128+23)      /* UWORD  */
  243. #define  UDNF_TOTDOWNLOADBYTES (128+24)      /* ULONG  */
  244.  
  245.  
  246. /* Note that DOWNLOADS and DOWNLOADBYTES refer to Downloads on ratio */
  247. /* they do not include files marked FreeDownload                     */
  248. /* TOTDOWNLOADS and TOTDOWNLOADBYTES do include freedownloads        */
  249.  
  250.